#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <cmath>




int gen_section(int section_len){
	int seed = std::pow(10, section_len-1); 
	int section = 3*(seed + (rand() % static_cast<int>(2*seed - seed + 1)));
	return section;	
}

long gen_pass(int section_len, int section_count){
	long pass = 0;
	for (int i=0; i<section_count; i++){
		int section = gen_section(section_len);
		pass+=(long)(section*(std::pow(10, (section_len)*i)));
	}
	return pass;
	
}
int main() {
	srand(time(0));
	int section_len = rand()%5 + 1;
	int section_count = 3;
	long password = gen_pass(section_len, section_count); 
	
	std::cout << "Сгенерированный пароль: " << password << std::endl;
    return 0;
}
